package com.zhf.demo02;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author: ZhaoHuanfeng
 * @Date: 2020/10/12 22:19
 */
public class HelloServlet3 extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("采用继承HTTPServlet类创建，开发中推荐该方式！");
    }

    @Override
    public void destroy() {
        System.out.println("销毁操作开始咯！");
    }

    @Override
    public void init() throws ServletException {
        System.out.println("开始初始化操作");
    }

    public HelloServlet3() {
        System.out.println("调用构造方法");
    }
}
